{% extends 'generic/object_detail.html' %}
{% load buttons %}
{% load helpers %}
{% load plugins %}

{% block buttons %}
        {% plugin_buttons object %}
        {% if perms.ipam.add_vlangroup %}
            {% clone_button object %}
        {% endif %}
        {% if perms.ipam.change_vlangroup %}
            {% edit_button object key="pk" %}
        {% endif %}
        {% if perms.ipam.delete_vlangroup %}
            {% delete_button object key="pk" %}
        {% endif %}
{% endblock buttons %}

{% block content_left_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>VLAN Group</strong>
            </div>
            <table class="table table-hover panel-body attr-table">
                <tr>
                    <td>Description</td>
                    <td>{{ object.description|placeholder }}</td>
                </tr>
                <tr>
                    <td>Site</td>
                    <td>
                        {% if object.site %}
                            <a href="{{ object.site.get_absolute_url }}">{{ object.site }}</a>
                        {% else %}
                            <span class="text-muted">None</span>
                        {% endif %}
                    </td>
                </tr>
                <tr>
                    <td>VLANs</td>
                    <td>
                        <a href="{% url 'ipam:vlan_list' %}?group={{ object.pk }}">{{ vlans_count }}</a>
                    </td>
                </tr>
            </table>
        </div>
{% endblock content_left_page %}

{% block content_right_page %}
    {% include 'utilities/obj_table.html' with table=vlan_table table_template='panel_table.html' heading='VLANs' bulk_edit_url='ipam:vlan_bulk_edit' bulk_delete_url='ipam:vlan_bulk_delete' vlan_group=object %}
{% endblock content_right_page %}
